import axios from '../../utils/request'
// router.get('/cart/list',auth, getCartList)
// router.post('/cart/add', auth,addToCart)
// router.delete('/cart/delete/:id', auth,delCart)
// router.put('/cart/setCount', auth,setCartCount)
// 获取购物车列表
function getCartList(query){
    return axios.get('/cart/list', {params:query})
}
// 添加到购物车
function addToCart(body){
    return axios.post('/cart/add', body)
}
// 修改购物车数量
function setCartCount(body){
    return axios.put('/cart/setcount', body)
}
// 删除购物车商品
function delCart(id){
    return axios.delete('/cart/delete/'+id)
}
export default {
    addToCart,
    setCartCount,
    getCartList,
    delCart
}